package com.huaweicloud.sdk.drs.v5.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowDirtyDataResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "count")

    private Integer count;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "dirty_data_list")

    private List<DirtyData> dirtyDataList = null;

    public ShowDirtyDataResponse withCount(Integer count) {
        this.count = count;
        return this;
    }

    /**
     * 总数。
     * @return count
     */
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public ShowDirtyDataResponse withDirtyDataList(List<DirtyData> dirtyDataList) {
        this.dirtyDataList = dirtyDataList;
        return this;
    }

    public ShowDirtyDataResponse addDirtyDataListItem(DirtyData dirtyDataListItem) {
        if (this.dirtyDataList == null) {
            this.dirtyDataList = new ArrayList<>();
        }
        this.dirtyDataList.add(dirtyDataListItem);
        return this;
    }

    public ShowDirtyDataResponse withDirtyDataList(Consumer<List<DirtyData>> dirtyDataListSetter) {
        if (this.dirtyDataList == null) {
            this.dirtyDataList = new ArrayList<>();
        }
        dirtyDataListSetter.accept(this.dirtyDataList);
        return this;
    }

    /**
     * 异常数据列表。
     * @return dirtyDataList
     */
    public List<DirtyData> getDirtyDataList() {
        return dirtyDataList;
    }

    public void setDirtyDataList(List<DirtyData> dirtyDataList) {
        this.dirtyDataList = dirtyDataList;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        ShowDirtyDataResponse that = (ShowDirtyDataResponse) obj;
        return Objects.equals(this.count, that.count) && Objects.equals(this.dirtyDataList, that.dirtyDataList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(count, dirtyDataList);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowDirtyDataResponse {\n");
        sb.append("    count: ").append(toIndentedString(count)).append("\n");
        sb.append("    dirtyDataList: ").append(toIndentedString(dirtyDataList)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
